<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <title>轨迹回放</title>
    <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" />
    <link rel="stylesheet" href="css/style.css" />
    <style>
        body {
            display: block
        }

        html,
        body,
        #container {
            height: 100%;
            width: 100%;
        }

        .input-card .btn {
            margin-right: 1.2rem;
            width: 9rem;
        }

        .input-card .btn:last-child {
            margin-right: 0;
        }

        .kkjjkseer {
            height: 70rem;
        }

        .amap-copyright {
            display: none !important
        }
    </style>
</head>

<body>
    <div class="kkjjkseer pr">
        <div id="container"></div>

        <div class="jhmnmjert pd">
            <div class="row drrtyser">
                <p class="z3 fz18 b col">
                    鲁A·66666
                </p>
                <div class="kjjjjmmert cen" onclick="startAnimation()">
                    <img src="img/righticon.png" class="cz dftgyse">
                    <span class="z3 fz14 ml5">轨迹回放</span>
                </div>
            </div>

            <div class="jjnmjjhsert mt15">
                <div class="row drftyyuure">
                    <div class="col">
                        <img src="img/usericon.png" class="yj ujjseerrt cz">
                        <span class="ml10 cz z3 b fz15">张里</span>
                    </div>
                    <div class="z3 fz14">
                        <span class="fz18 b">9.0</span>
                        分
                    </div>
                </div>
                <ul class="lkjjhse pd fz14  ">
                    <li>
                        <span class="z3">济南历下区山大路16号印象城南门</span>
                    </li>
                     <li>
                        <span class="z3">济南长清区长清大学城大学路</span>
                    </li>
                </ul>
                <p class="z3 mt10 fz14">
                2020年01月02日 12:00-15:00
                </p>

            </div>

        </div>
        
        <div class="pd jjhnnxeert">
            <div class="row jnnmxerttyse cen">
                <div class="col z9 fz12">
                    平均速度
                    <p class="z3 fz14 b">
                        2 <span>km/h</span>
                    </p>
                </div>
                
                 <div class="col z9 fz12">
                    里程数
                    <p class="z3 fz14 b">
                        2 <span>km</span>
                    </p>
                </div>
                
                 <div class="col z9 fz12">
                    总用时
                    <p class="z3 fz14 b">
                        12 <span>min</span>
                    </p>
                </div>
            </div>
            
            <div class="jhjnmdeer mt10">
                <p class="fz16 z3">
                数据分析
                </p>
                <div class="row mt10">
                    <label class="jjnnkdert fz14">
                        安全指数1
                    </label>
                    <p class="fz14 z6 col">
                    建议开车不要着急
                    </p>
                </div>
                <div class="row mt10">
                    <label class="jjnnkdert fz14">
                        环保指数1
                    </label>
                    <p class="fz14 z6 col">
                    环保建议环保建议环保建议
                    </p>
                </div>
                <div class="row mt10 ">
                    <label class="jjnnkdert fz14">
                        操控指数1
                    </label>
                    <p class="fz14 z6 col">
                    安全建议安全建议安全
                    </p>
                </div>
            </div>
            
            
                    <div class="jhjnmdeer mt10">
                <p class="fz16 z3">
                安驾指数
                </p>
                <div class="row mt10">
                    <label class="jjnnkdert fz14">
                       文明指数1
                    </label>
                    <p class="fz14 z6 col">
                    建议开车不要着急
                    </p>
                </div>
                <div class="row mt10">
                    <label class="jjnnkdert fz14">
                        安全指数1
                    </label>
                    <p class="fz14 z6 col">
                    环保建议环保建议环保建议
                    </p>
                </div>
              
            </div>
            
        </div>

    </div>



    <div class="input-card">
        <h4>轨迹回放控制</h4>
        <div class="input-item">
            <input type="button" class="btn" value="开始动画" id="start" onclick="startAnimation()" />
            <input type="button" class="btn" value="暂停动画" id="pause" onclick="pauseAnimation()" />
        </div>
        <div class="input-item">
            <input type="button" class="btn" value="继续动画" id="resume" onclick="resumeAnimation()" />
            <input type="button" class="btn" value="停止动画" id="stop" onclick="stopAnimation()" />
        </div>
    </div>
    <script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.15&key=您申请的key值"></script>
    <script>
        var marker, lineArr = [
            [113.948274, 22.564908],
            [113.944326, 22.548976],
            [113.957287, 22.546994],
            [113.949476, 22.515521],
            [113.921839, 22.520437],
            [113.931795, 22.569426]
        ]

        var map = new AMap.Map("container", {
            center: [113.933855, 22.540732],
            zoom: 12
        });

        marker = new AMap.Marker({
            map: map,
            position: [113.948274, 22.564908],
            icon: "./img/fsdfsda.png",
            offset: new AMap.Pixel(-22, -22),
            autoRotation: true,
        });
        markerert4 = new AMap.Marker({
            map: map,
            position: [113.931795, 22.569426],
            icon: "./img/fsdfsdb.png",
            offset: new AMap.Pixel(-22, -22),
            autoRotation: true,
        });

        // 绘制轨迹
        var polyline = new AMap.Polyline({
            map: map,
            path: lineArr,
            showDir: true,
            strokeColor: "#46A2DB", //线颜色
            // strokeOpacity: 1,     //线透明度
            strokeWeight: 6, //线宽
            // strokeStyle: "solid"  //线样式
        });

        var passedPolyline = new AMap.Polyline({
            map: map,
            // path: lineArr,
            strokeColor: "#47D9C6", //线颜色
            // strokeOpacity: 1,     //线透明度
            strokeWeight: 6, //线宽
            // strokeStyle: "solid"  //线样式
        });


        marker.on('moving', function(e) {
            passedPolyline.setPath(e.passedPath);
        });

        map.setFitView();

        function startAnimation() {
            marker.moveAlong(lineArr, 4000);
        }

        function pauseAnimation() {
            marker.pauseMove();
        }

        function resumeAnimation() {
            marker.resumeMove();
        }

        function stopAnimation() {
            marker.stopMove();
        }
    </script>
</body></html>